<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1、Map的定义
        let map1=new Map();
        let map2=new Map([['a',100],['b',200],['c',300]]); //a表示key键，100表示value值

        //2、添加元素
        map2.set('d',400);

        //3、删除元素
        map2.delete('a');

        //4、获得元素个数
        console.log(map2.size);

        //5、获取元素
        console.log(map2.get('b'));

        //6、清空元素
        map2.clear();

        //7、是否存在某个元素
        console.log(map2.has('c'));

        console.log(map2);
    </script>
</body>
</html>